from LongUI.page.login_page import LoginPage
from selenium.webdriver.common.by import By

class QxPage(LoginPage):
    # 断言系统菜单
    dy1_loc = By.XPATH, '//*[@id="sidebar"]/div[1]/h2'
    def dy1(self):
        return self.text(self.dy1_loc)

    # 点击权限管理
    qx_loc=By.XPATH,'//*[@id="sidebar"]/div[2]/div[2]/ul/li[2]/div/a'
    def qx(self):
        self.click(self.qx_loc)

    #输入权限名称
    qxname_loc=By.NAME,'permissionName'
    def qxname(self):
        self.send_keys(self.qxname_loc,'权限管理')

    # 点击查询
    get_loc=By.XPATH,'//*[@id="pagerForm"]/div/table/tbody/tr/td[3]/div/ul/li/div/div/button'
    def get(self):
        self.click(self.get_loc)

    def qxpage(self):
        self.longguo_login()
        print(self.dy1())
        assert '系统菜单' == self.dy1()
        self.qx()
        self.qxname()
        self.get()